﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace WmsApp.UI
{
    public partial class QStoreGoodsPrepare : QStoreGoods
    {
        public QStoreGoodsPrepare()
        {
            InitializeComponent();
        }

        #region IQueryControl Members

        public new string GetCondition()
        {
            string condition = "";
            if (lookUpEditGoodsState.EditValue != null && !String.IsNullOrEmpty(lookUpEditGoodsState.EditValue.ToString()))
            {
                condition += (String.Format(" and  Quantity {0} SafeStoreQty ", lookUpEditGoodsState.EditValue));
            }
            if (this.lookUpEditGoodsCodeType.EditValue != null && !String.IsNullOrEmpty(lookUpEditGoodsCodeType.EditValue.ToString()))
            {
                condition += (String.Format(" and NewGoodsCode ='{0}'", lookUpEditGoodsCodeType.EditValue));
            }
            //if (this.lookUpEditStoreType.EditValue != null && !String.IsNullOrEmpty(lookUpEditStoreType.EditValue.ToString()))
            //{
            //    condition += (String.Format(" and StoreTypeCode ='{0}' ", lookUpEditStoreType.EditValue));
            //}
            //if (this.lookUpEditUnit.EditValue != null && !String.IsNullOrEmpty(lookUpEditUnit.EditValue.ToString()))
            //{
            //    condition += (String.Format(" and UnitCode ='{0}' ", lookUpEditUnit.EditValue));
            //}

            if (!String.IsNullOrEmpty(this.textEditLikeNewGoodsName.Text.Trim()))
            {
                condition += (String.Format(" and NewGoodsName like '%{0}%' ", this.textEditLikeNewGoodsName.Text.Trim()));
            }

            return condition;
        }

        #endregion
    }
}
